﻿@using Jugg.Mapping.SysRole
@model SysRoleMapping
@{
    ViewBag.Title = "编辑角色";
}

<div class="row">
    <div class="col-sm-12">
        @using (Html.BeginRouteForm("editRole", new { }, FormMethod.Post, new { id = "formRole", @class = "form-horizontal", onsubmit = "return false;" }))
        {
            @Html.HiddenFor(m => m.Id)
            @Html.AntiForgeryToken()
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right">@RequiredSpan()角色名称</label>
                <div class="col-sm-6">
                    @Html.TextBoxFor(m => m.Name, new { @class = "form-control", placeholder = "角色名称" })
                    @Html.ValidationMessageFor(m => m.Name)
                    <p class="help-block">角色名称必填切不能重复.</p>
                </div>
            </div>
            <div class="col-md-offset-2 col-md-9">
                <button class="btn btn-info btn-sm " type="submit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    提交
                </button>
            </div>
        }
    </div>
</div>
<script>
    $(function () {
        $.validator.unobtrusive.parse($('#formRole'));
        $('#formRole').submit(function (e) {
            if ($(this).valid()) {
                $(this).ajaxSubmit(function (data) {
                    $.modal.gritter(data, function () {
                        $.modal.reload();
                    })
                });
            }
        });
    });
</script>